public class RationalMain {
    public static void main(String[] args) {
        Rational r1 = new Rational(7, 4);
        Rational r2 = new Rational(5, 3);

        Rational sum = r1.add(r2);
        System.out.println(r1.getNumerator() + "/" + r1.getDenominator() + "与" + r2.getNumerator() + "/" + r2.getDenominator() + "之和是" + sum.getNumerator() + "/" + sum.getDenominator());

        Rational sub = r1.sub(r2);
        System.out.println(r1.getNumerator() + "/" + r1.getDenominator() + "与" + r2.getNumerator() + "/" + r2.getDenominator() + "之差是" + sub.getNumerator() + "/" + sub.getDenominator());


        Rational muti = r1.muti(r2);
        System.out.println(r1.getNumerator() + "/" + r1.getDenominator() + "与" + r2.getNumerator() + "/" + r2.getDenominator() + "之积是" + muti.getNumerator() + "/" + muti.getDenominator());


        Rational div = r1.div(r2);
        System.out.println(r1.getNumerator() + "/" + r1.getDenominator() + "与" + r2.getNumerator() + "/" + r2.getDenominator() + "之商是" + div.getNumerator() + "/" + div.getDenominator());
    }
}

